package Day02;

import util.音频;

import java.util.Random;
import java.util.Scanner;

public class words {
    public static void main(String[] args) {
        int count = 0;  //分数默认为0
        for (;;){
            Random rd = new Random();  //随机数
            Scanner sc = new Scanner(System.in);

            String words[] = {
                    "InputStream","OutputStream","DataInputStream","DataOutputStream","ObjectInputStream","ObjectOutputStream"
            };
            String fy[]={
                    "输入流","输出流","中文输入流","中文输出流","东西输入流","东西输出流"
            };

            int x =rd.nextInt(6);
            System.out.println("请输入"+words[x]+"------翻译："+fy[x]);
            String text = sc.next();  //用户输入的单词

            //判断是否正确
            if (text.equals(words[x])){
                count++;
                System.out.println("您答对了！当前分数为："+count);

            }else{
                count-=4;
                System.out.println("您打错了！当前分数"+count);
            }
        }
    }
}
